<!--
 * 全宗实体 查询组件
 * :
 * @version: 1.0
 * @author: lakeside hubin_yuan.410@hotmail.com
 * @date: 20120-07-14
 * @LastEditors:
 * @LastEditTime:
 -->
<template>
  <el-form ref="fondsEntitySearchForm" :model="search.criteria" :rules="rules" label-position="right"
           label-width="6rem">
    <el-row justify="center" type="flex"><span class="p-1 span_tag">需要根据索引调整可支持的查询字段</span></el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="通用搜索" prop="remarkNote">
          <el-input v-model="search.criteria.filter" autocomplete="off" clearable
                    placeholder="支持【空】模糊搜索"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="层级名称" prop="layerName">
          <el-input v-model="search.criteria.layerName"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="层级" prop="level">
          <el-input-number v-model="search.criteria.level" :controls="false"></el-input-number>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="模型" prop="model">
          <el-input v-model="search.criteria.model"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="名称" prop="name">
          <el-input v-model="search.criteria.name"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="上级主键" prop="parentId">
          <el-input v-model="search.criteria.parentId"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="编码" prop="code">
          <el-input v-model="search.criteria.code"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="层级编码" prop="layerCode">
          <el-input v-model="search.criteria.layerCode"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="上级编码" prop="parentCode">
          <el-input v-model="search.criteria.parentCode"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="是否固定" prop="hasFixed">
          <el-switch v-model="search.criteria.hasFixed"></el-switch>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="创建者" prop="createdByName">
          <el-input v-model="search.criteria.createdByName" autocomplete="off"></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="最后修改者" prop="modifiedByName">
          <el-input v-model="search.criteria.modifiedByName" autocomplete="off"></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="24" :md="24">
        <el-form-item label="创建时间" prop="createdDate">
          <el-date-picker v-model="search.criteria.createdDate" align="l" end-placeholder="结束日期"
                          format="yyyy-MM-dd HH:mm:ss" range-separator="至"
                          start-placeholder="开始日期" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col :lg="24" :md="24">
        <el-form-item label="最后修改时间" prop="modifiedDate">
          <el-date-picker v-model="search.criteria.modifiedDate" align="l" end-placeholder="结束日期"
                          format="yyyy-MM-dd HH:mm:ss" range-separator="至"
                          start-placeholder="开始日期" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss">
          </el-date-picker>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <!--<el-col :md="24" :lg="24">
          <el-form-item label="备注描述" prop="remarkNote">
              <el-input type="textarea" :autosize="{minRows: 2}" v-model="search.criteria.remarkNote"autocomplete="off"></el-input>
          </el-form-item>
      </el-col>-->
      <el-col :lg="12" :md="24">
        <el-form-item label="有效状态" prop="validStatus">
          <dict-option-select v-model="search.criteria.validStatus" :dictField="this.$constants.coreDict.validStatus.key"
                              autocomplete="off"
                              multiple placeholder=""></dict-option-select>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
import DictOptionSelect from "@/views/system/components/DictOptionSelect";

export default {
  name: "dossierFondsEntitySearch",
  model: {
    prop: 'search',
  },
  props: {
    search: {type: Object},
  },
  components: {DictOptionSelect},
  data() {
    return {
      rules: {
        layerName: [
          {max: 65535, message: '层级名称最大长度为65535', trigger: ['blur', 'change']},
        ],
        level: [
          {type: 'integer', message: '层级必须为数字整数', trigger: ['blur', 'change']},
        ],
        model: [
          {max: 20, message: '模型最大长度为20', trigger: ['blur', 'change']},
        ],
        name: [
          {max: 20, message: '名称最大长度为20', trigger: ['blur', 'change']},
        ],
        parentId: [
          {max: 36, message: '上级主键最大长度为36', trigger: ['blur', 'change']},
        ],
        code: [
          {max: 3, message: '编码最大长度为3', trigger: ['blur', 'change']},
        ],
        layerCode: [
          {max: 65535, message: '层级编码最大长度为65535', trigger: ['blur', 'change']},
        ],
        parentCode: [
          {max: 36, message: '上级编码最大长度为36', trigger: ['blur', 'change']},
        ],
        hasFixed: [],
      }
    }
  },
  methods: {
    /**表单校验回调*/
    async validate(callback) {
      return await this.$refs.fondsEntitySearchForm.validate(callback)
    },
  }
}
</script>

<style lang="scss" scoped>

</style>
